//自动化脚本去注册路由
const fs = require('fs');
module.exports = (app)=>{
    fs.readdirSync(__dirname).forEach(file => {
        if(file === 'index.js'){
            return;
        }
        const route = require(`./${file}`);
        app.use(route.routes()).use(route.allowedMethods());  
    })
}